package cn.singno.bob.exception;

import cn.singno.bob.emun.BusinessCode;
import cn.singno.bob.emun.CommonEmun;

/**
 * 业务异常类
 * @author 鲍建明
 *
 */
public class BusinessException extends Exception{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Integer code;
	private String message;
	
	
	public BusinessException(BusinessCode businessCode){
		this.code = businessCode.getCode();
		this.message = businessCode.getMessage();
	}
	
	public BusinessException(Integer code, String messge){
		this.code = code;
		this.message = messge;
	}
	
	public BusinessException(String message){
		this.code = CommonEmun.ERROR.getCode();
		this.message = message;
	}
	
	
	public Integer getCode(){
		return this.code;
	}
	
	public String getMessage(){
		return this.message;
	}
	
}
